package test;

import java.io.File;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;

public class testByteBuffer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ByteBuffer bb = ByteBuffer.allocate(1024);
		byte[] buffer = new byte[1024];
		bb.putFloat(1000, 3434.4f);
		bb.position(0);
		while(bb.position()!=1024)
			System.out.println(bb.getFloat());
		try {
			FileOutputStream file=new FileOutputStream(new File("test.dat"));
			buffer = bb.array();
			file.write(buffer);
			file.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
